package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维护-维护类型
type vehicleMaintainType int

var VehicleMaintainType vehicleMaintainType

// 车辆不在线
func (c *vehicleMaintainType) VehicleOnline() int {
	return 1
}

// 车辆不定位
func (c *vehicleMaintainType) VehicleLocate() int {
	return 2
}

// 测试选项
func (c *vehicleMaintainType) TestChoose() int {
	return 3
}

// 轨迹问题
func (c *vehicleMaintainType) Trajectory() int {
	return 4
}

// 速度问题
func (c *vehicleMaintainType) Speed() int {
	return 5
}

// 图像问题
func (c *vehicleMaintainType) Image() int {
	return 6
}

// 移机
func (c *vehicleMaintainType) MoveHost() int {
	return 7
}

// 启动问题
func (c *vehicleMaintainType) Start() int {
	return 8
}

// 限速
func (c *vehicleMaintainType) LimitSpeed() int {
	return 9
}

// 锁车
func (c *vehicleMaintainType) Lock() int {
	return 10
}

// sd卡问题
func (c *vehicleMaintainType) Sd() int {
	return 11
}

// 显示屏问题
func (c *vehicleMaintainType) Display() int {
	return 12
}

// 主机显示屏问题
func (c *vehicleMaintainType) HostDisplay() int {
	return 13
}

// 硬盘问题
func (c *vehicleMaintainType) Disk() int {
	return 14
}

// 其他问题
func (c *vehicleMaintainType) OtherProblem() int {
	return 15
}

func (c *vehicleMaintainType) ToText(value int) string {
	switch value {

	case 1:
		return "车辆不在线"

	case 2:
		return "车辆不定位"

	case 3:
		return "测试选项"

	case 4:
		return "轨迹问题"

	case 5:
		return "速度问题"

	case 6:
		return "图像问题"

	case 7:
		return "移机"

	case 8:
		return "启动问题"

	case 9:
		return "限速"

	case 10:
		return "锁车"

	case 11:
		return "sd卡问题"

	case 12:
		return "显示屏问题"

	case 13:
		return "主机显示屏问题"

	case 14:
		return "硬盘问题"

	case 15:
		return "其他问题"

	}
	return ""
}

func (c *vehicleMaintainType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainType) ToValue(text string) int {
	switch text {

	case "车辆不在线":
		return 1

	case "车辆不定位":
		return 2

	case "测试选项":
		return 3

	case "轨迹问题":
		return 4

	case "速度问题":
		return 5

	case "图像问题":
		return 6

	case "移机":
		return 7

	case "启动问题":
		return 8

	case "限速":
		return 9

	case "锁车":
		return 10

	case "sd卡问题":
		return 11

	case "显示屏问题":
		return 12

	case "主机显示屏问题":
		return 13

	case "硬盘问题":
		return 14

	case "其他问题":
		return 15

	}
	return 0
}
